.class public Les/vf0;
.super Les/nf0;
.source "RunDialog.java"


# annotations
.annotation system Ldalvik/annotation/MemberClasses;
    value = {
        Les/vf0$c;
    }
.end annotation


# instance fields
.field private b:Ljava/util/ArrayList;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/ArrayList<",
            "Les/vf0$c;",
            ">;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(Landroid/content/Context;)V
    .locals 4

    .line 1
    invoke-direct {p0, p1}, Les/nf0;-><init>(Landroid/content/Context;)V

    .line 2
    new-instance v0, Ljava/util/ArrayList;

    invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V

    iput-object v0, p0, Les/vf0;->b:Ljava/util/ArrayList;

    .line 3
    new-instance v1, Les/vf0$c;

    sget v2, Lcom/jecelyin/editor/v2/m;->je_use_sl4a_in_background_run_script:I

    invoke-virtual {p1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Les/vf0$c;-><init>(ILjava/lang/String;)V

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 4
    iget-object v0, p0, Les/vf0;->b:Ljava/util/ArrayList;

    new-instance v1, Les/vf0$c;

    sget v2, Lcom/jecelyin/editor/v2/m;->je_use_sl4a_in_terminal_run_script:I

    invoke-virtual {p1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Les/vf0$c;-><init>(ILjava/lang/String;)V

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 5
    iget-object v0, p0, Les/vf0;->b:Ljava/util/ArrayList;

    new-instance v1, Les/vf0$c;

    sget v2, Lcom/jecelyin/editor/v2/m;->je_preview_in_browser:I

    invoke-virtual {p1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    invoke-direct {v1, v2, v3}, Les/vf0$c;-><init>(ILjava/lang/String;)V

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    .line 6
    iget-object v0, p0, Les/vf0;->b:Ljava/util/ArrayList;

    new-instance v1, Les/vf0$c;

    sget v2, Lcom/jecelyin/editor/v2/m;->je_other_application:I

    invoke-virtual {p1, v2}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object p1

    invoke-direct {v1, v2, p1}, Les/vf0$c;-><init>(ILjava/lang/String;)V

    invoke-virtual {v0, v1}, Ljava/util/ArrayList;->add(Ljava/lang/Object;)Z

    return-void
.end method

.method private a(I)V
    .locals 5

    .line 4
    :try_start_0
    invoke-virtual {p0}, Les/nf0;->b()Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    move-result-object v0

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/ui/JeEditorActivity;->A()Lcom/jecelyin/editor/v2/ui/g;

    move-result-object v0

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/ui/g;->d()Lcom/jecelyin/editor/v2/adapter/EditorAdapter;

    move-result-object v0

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/adapter/EditorAdapter;->b()Lcom/jecelyin/editor/v2/ui/b;

    move-result-object v0

    invoke-virtual {v0}, Lcom/jecelyin/editor/v2/ui/b;->f()Ljava/lang/String;

    move-result-object v0
    :try_end_0
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_1

    .line 5
    invoke-static {v0}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v1

    if-eqz v1, :cond_0

    .line 6
    iget-object p1, p0, Les/nf0;->a:Landroid/content/Context;

    sget v0, Lcom/jecelyin/editor/v2/m;->je_please_save_as_file_first:I

    invoke-static {p1, v0}, Lcom/jecelyin/common/utils/e;->b(Landroid/content/Context;I)V

    return-void

    .line 7
    :cond_0
    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 8
    invoke-static {v1}, Landroid/net/Uri;->fromFile(Ljava/io/File;)Landroid/net/Uri;

    move-result-object v0

    .line 9
    invoke-static {}, Lcom/jecelyin/editor/v2/utils/f;->a()Lcom/jecelyin/editor/v2/utils/f;

    move-result-object v2

    invoke-virtual {v1}, Ljava/io/File;->getName()Ljava/lang/String;

    move-result-object v3

    invoke-virtual {v2, v3}, Lcom/jecelyin/editor/v2/utils/f;->a(Ljava/lang/String;)Ljava/lang/String;

    move-result-object v2

    .line 10
    iget-object v3, p0, Les/vf0;->b:Ljava/util/ArrayList;

    invoke-virtual {v3, p1}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object p1

    check-cast p1, Les/vf0$c;

    const/4 v3, 0x0

    .line 11
    iget p1, p1, Les/vf0$c;->a:I

    sget v4, Lcom/jecelyin/editor/v2/m;->je_use_sl4a_in_background_run_script:I

    if-ne p1, v4, :cond_1

    .line 12
    invoke-static {v1}, Lcom/jecelyin/editor/v2/utils/g;->a(Ljava/io/File;)Landroid/content/Intent;

    move-result-object v3

    goto :goto_0

    .line 13
    :cond_1
    sget v4, Lcom/jecelyin/editor/v2/m;->je_use_sl4a_in_terminal_run_script:I

    if-ne p1, v4, :cond_2

    .line 14
    invoke-static {v1}, Lcom/jecelyin/editor/v2/utils/g;->b(Ljava/io/File;)Landroid/content/Intent;

    move-result-object v3

    goto :goto_0

    .line 15
    :cond_2
    sget v4, Lcom/jecelyin/editor/v2/m;->je_preview_in_browser:I

    if-ne p1, v4, :cond_3

    .line 16
    invoke-direct {p0, v1}, Les/vf0;->a(Ljava/io/File;)V

    goto :goto_0

    .line 17
    :cond_3
    sget v1, Lcom/jecelyin/editor/v2/m;->je_other_application:I

    if-ne p1, v1, :cond_4

    .line 18
    new-instance p1, Landroid/content/Intent;

    const-string v1, "android.intent.action.VIEW"

    invoke-direct {p1, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;)V

    .line 19
    invoke-virtual {p1, v0, v2}, Landroid/content/Intent;->setDataAndType(Landroid/net/Uri;Ljava/lang/String;)Landroid/content/Intent;

    .line 20
    iget-object v0, p0, Les/nf0;->a:Landroid/content/Context;

    sget v1, Lcom/jecelyin/editor/v2/m;->je_chooser_application:I

    invoke-virtual {v0, v1}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v0

    invoke-static {p1, v0}, Landroid/content/Intent;->createChooser(Landroid/content/Intent;Ljava/lang/CharSequence;)Landroid/content/Intent;

    move-result-object v3

    :cond_4
    :goto_0
    if-eqz v3, :cond_5

    .line 21
    iget-object p1, p0, Les/nf0;->a:Landroid/content/Context;

    invoke-virtual {p1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object p1

    invoke-virtual {v3, p1}, Landroid/content/Intent;->resolveActivity(Landroid/content/pm/PackageManager;)Landroid/content/ComponentName;

    move-result-object p1

    if-eqz p1, :cond_5

    .line 22
    :try_start_1
    invoke-virtual {p0}, Les/nf0;->b()Lcom/jecelyin/editor/v2/ui/JeEditorActivity;

    move-result-object p1

    invoke-virtual {p1, v3}, Landroid/app/Activity;->startActivity(Landroid/content/Intent;)V
    :try_end_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_0

    goto :goto_1

    :catch_0
    move-exception p1

    .line 23
    invoke-static {p1}, Lcom/jecelyin/common/utils/c;->a(Ljava/lang/Throwable;)I

    .line 24
    iget-object p1, p0, Les/nf0;->a:Landroid/content/Context;

    sget v0, Lcom/jecelyin/editor/v2/m;->je_run_fail_message:I

    invoke-static {p1, v0}, Lcom/jecelyin/common/utils/e;->b(Landroid/content/Context;I)V

    :cond_5
    :goto_1
    return-void

    :catch_1
    move-exception p1

    .line 25
    invoke-static {p1}, Lcom/jecelyin/common/utils/c;->b(Ljava/lang/Throwable;)I

    .line 26
    iget-object p1, p0, Les/nf0;->a:Landroid/content/Context;

    sget v0, Lcom/jecelyin/editor/v2/m;->je_editor_initialing:I

    invoke-static {p1, v0}, Lcom/jecelyin/common/utils/e;->b(Landroid/content/Context;I)V

    return-void
.end method

.method static synthetic a(Les/vf0;I)V
    .locals 0

    .line 1
    invoke-direct {p0, p1}, Les/vf0;->a(I)V

    return-void
.end method

.method private a(Ljava/io/File;)V
    .locals 7

    .line 27
    new-instance v0, Landroid/content/Intent;

    const-string v1, "http://www.estrongs.com"

    invoke-static {v1}, Landroid/net/Uri;->parse(Ljava/lang/String;)Landroid/net/Uri;

    move-result-object v1

    const-string v2, "android.intent.action.VIEW"

    invoke-direct {v0, v2, v1}, Landroid/content/Intent;-><init>(Ljava/lang/String;Landroid/net/Uri;)V

    .line 28
    iget-object v1, p0, Les/nf0;->a:Landroid/content/Context;

    invoke-virtual {v1}, Landroid/content/Context;->getPackageManager()Landroid/content/pm/PackageManager;

    move-result-object v1

    const/high16 v2, 0x10000

    invoke-virtual {v1, v0, v2}, Landroid/content/pm/PackageManager;->queryIntentActivities(Landroid/content/Intent;I)Ljava/util/List;

    move-result-object v0

    .line 29
    new-instance v1, Lcom/jecelyin/common/widget/dialog/a$c;

    iget-object v2, p0, Les/nf0;->a:Landroid/content/Context;

    invoke-direct {v1, v2}, Lcom/jecelyin/common/widget/dialog/a$c;-><init>(Landroid/content/Context;)V

    .line 30
    const-class v2, Lcom/jecelyin/common/widget/dialog/vh/IntentChooseViewHolder;

    invoke-virtual {v1, v2}, Lcom/jecelyin/common/widget/dialog/a$c;->a(Ljava/lang/Class;)I

    move-result v2

    .line 31
    new-instance v3, Ljava/util/ArrayList;

    invoke-direct {v3}, Ljava/util/ArrayList;-><init>()V

    const/4 v4, 0x0

    .line 32
    :goto_0
    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v5

    if-ge v4, v5, :cond_0

    .line 33
    new-instance v5, Lcom/jecelyin/common/widget/dialog/DialogListAdapter$b;

    invoke-direct {v5, v2}, Lcom/jecelyin/common/widget/dialog/DialogListAdapter$b;-><init>(I)V

    .line 34
    invoke-interface {v0, v4}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v6

    iput-object v6, v5, Lcom/jecelyin/common/widget/dialog/DialogListAdapter$b;->d:Ljava/lang/Object;

    .line 35
    invoke-interface {v3, v5}, Ljava/util/List;->add(Ljava/lang/Object;)Z

    add-int/lit8 v4, v4, 0x1

    goto :goto_0

    .line 36
    :cond_0
    sget v2, Lcom/jecelyin/editor/v2/m;->je_chooser_browser:I

    invoke-virtual {v1, v2}, Lcom/jecelyin/common/widget/dialog/a$c;->f(I)Lcom/jecelyin/common/widget/dialog/a$c;

    .line 37
    invoke-virtual {v1, v3}, Lcom/jecelyin/common/widget/dialog/a$c;->a(Ljava/util/List;)Lcom/jecelyin/common/widget/dialog/a$c;

    .line 38
    new-instance v2, Les/vf0$b;

    invoke-direct {v2, p0, v0, p1}, Les/vf0$b;-><init>(Les/vf0;Ljava/util/List;Ljava/io/File;)V

    invoke-virtual {v1, v2}, Lcom/jecelyin/common/widget/dialog/a$c;->a(Lcom/jecelyin/common/widget/dialog/a$d;)Lcom/jecelyin/common/widget/dialog/a$c;

    .line 39
    invoke-virtual {v1}, Lcom/jecelyin/common/widget/dialog/a$c;->c()Lcom/jecelyin/common/widget/dialog/a;

    return-void
.end method


# virtual methods
.method protected bridge synthetic a()Lcom/jecelyin/common/widget/dialog/a$c;
    .locals 1

    .line 2
    invoke-virtual {p0}, Les/vf0;->a()Lcom/jecelyin/common/widget/dialog/c;

    move-result-object v0

    return-object v0
.end method

.method protected a()Lcom/jecelyin/common/widget/dialog/c;
    .locals 2

    .line 3
    new-instance v0, Lcom/jecelyin/common/widget/dialog/c;

    iget-object v1, p0, Les/nf0;->a:Landroid/content/Context;

    invoke-direct {v0, v1}, Lcom/jecelyin/common/widget/dialog/c;-><init>(Landroid/content/Context;)V

    return-object v0
.end method

.method public c()V
    .locals 4

    .line 1
    iget-object v0, p0, Les/vf0;->b:Ljava/util/ArrayList;

    invoke-virtual {v0}, Ljava/util/ArrayList;->size()I

    move-result v0

    .line 2
    new-array v1, v0, [Ljava/lang/String;

    const/4 v2, 0x0

    :goto_0
    if-ge v2, v0, :cond_0

    .line 3
    iget-object v3, p0, Les/vf0;->b:Ljava/util/ArrayList;

    invoke-virtual {v3, v2}, Ljava/util/ArrayList;->get(I)Ljava/lang/Object;

    move-result-object v3

    check-cast v3, Les/vf0$c;

    iget-object v3, v3, Les/vf0$c;->b:Ljava/lang/String;

    aput-object v3, v1, v2

    add-int/lit8 v2, v2, 0x1

    goto :goto_0

    .line 4
    :cond_0
    invoke-virtual {p0}, Les/vf0;->a()Lcom/jecelyin/common/widget/dialog/c;

    move-result-object v0

    invoke-virtual {v0, v1}, Lcom/jecelyin/common/widget/dialog/c;->a([Ljava/lang/CharSequence;)Lcom/jecelyin/common/widget/dialog/c;

    sget v1, Lcom/jecelyin/editor/v2/m;->je_run:I

    .line 5
    invoke-virtual {v0, v1}, Lcom/jecelyin/common/widget/dialog/a$c;->f(I)Lcom/jecelyin/common/widget/dialog/a$c;

    sget v1, Lcom/jecelyin/editor/v2/m;->je_close:I

    .line 6
    invoke-virtual {v0, v1}, Lcom/jecelyin/common/widget/dialog/a$c;->d(I)Lcom/jecelyin/common/widget/dialog/a$c;

    new-instance v1, Les/vf0$a;

    invoke-direct {v1, p0}, Les/vf0$a;-><init>(Les/vf0;)V

    .line 7
    invoke-virtual {v0, v1}, Lcom/jecelyin/common/widget/dialog/a$c;->a(Lcom/jecelyin/common/widget/dialog/a$d;)Lcom/jecelyin/common/widget/dialog/a$c;

    .line 8
    invoke-virtual {v0}, Lcom/jecelyin/common/widget/dialog/a$c;->c()Lcom/jecelyin/common/widget/dialog/a;

    move-result-object v0

    .line 9
    invoke-virtual {p0, v0}, Les/nf0;->a(Lcom/jecelyin/common/widget/dialog/a;)V

    return-void
.end method
